Product Code Database
Example Keywords: the orange -handheld $70
barcode-scavenger
   » » Help: Markup Validation
Tag Help 'Markup Validation'.
Tag
The lets editors check web pages for conformance to and standards. It is helpful for catching minor problems such as duplicate section names or citation IDs. Although most major browsers will tolerate many of the errors, and will display a document successfully even if it contains errors, they may misbehave on documents that contain the errors: for example, they may go to the wrong section or citation if you click the mouse on a wikilink. Checking that a page contains valid HTML can thus fix these minor glitches while also increasing portability to unusual browsers.

To check the HTML for a Wikipedia article XYZ, visit the service's home page and enter the text "<span class="plainlinks">{{fullurl:XYZ}}</span>".


Current issues
These errors require developer fixes and should be ignored by editors. When checking for endemic errors, ensure a blank page is used, such as .

As of September 17, 2012, all pages being validated will show these errors:

  • Bad value ResourceLoaderDynamicStyles for attribute name on element meta: Keyword resourceloaderdynamicstyles is not registered.

Any page with an edit link:

  • Bad value edit for attribute rel on element link: Keyword edit is not registered. This issue does not show for .

Any page with multiple uses of :

  • Duplicate ID searchbox or Duplicate ID createbox.

Any page with a file (image):

  • Attribute srcset not allowed on element img at this point.

Any page with a nonstandard language code:

  • Bad value <var>xxx</var> for attribute lang on element a: The language subtag <var>xxx</var> is not a valid ISO language part of a language tag.
Some Wikipedias use language codes that are not listed per RFC 5646. See the deprecated and nonstandard languages at . See also .


Valid HTML
While current browsers are quite forgiving of HTML errors, invalid HTML can cause issues with accessibility, search engines and portability. Various browsers may handle errors differently, thus the display may differ.

For most editors, creating valid HTML is not an issue. The software converts wikimarkup into valid HTML (with occasional bugs). The English Wikipedia uses to help ensure that common mistakes are converted into proper HTML, however Tidy will not fix all problems, there is no way to disable it for testing and validation will not show issues fixed by Tidy.

Portability issues occur when pages are exported to other wikis that do not use HTML Tidy and HTML errors are exposed.

Editors who use referencing methods such as should always validate pages. Use of these templates make it very easy for an editor to create duplicate HTML ids, causing invalid HTML and in-page linking issues— this is probably the most common validation issue on Wikipedia. There is little or no error checking for manual templates.

Editors who develop templates should always test various uses and ensure they render valid HTML.


Validation tools
The is the main international standards organization for the internet— they provide the . Simply copy the full URL of the page to be validated and paste in into the validator. There is also a that you can add to your browser bookmarks that will validate the current page.

The WDG HTML Validator has a batch mode that allows a list of URLS to be validated.

is a user script that will add sharing links and include tools including W3C Markup Validation.


Common diagnostics and how to fix them
This section gives examples of diagnostics generated by the markup validation service, and suggests possible fixes. Diagnostics are by line and column of the generated HTML for the page. It may be helpful to obtain the HTML in order to understand the diagnostic. For example, if you using the browser, you can type control-U to see the HTML.


ID already defined
Line 630, Column 88: ID "CITEREFBarker2008" already defined
<nowiki></nowiki><abbr title="Position where error was detected." style="color:red"><strong>C</strong></abbr>ITEREFBarker2008">Barker, Janice (2008-0
: An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).

This error occurs if an article contains multiple invocations of the template with the same author and year; the above error was prompted by an article that cited two different documents, both written by Barker in 2008. Disambiguate the citations by putting letters after the years (e.g., , ), or by using the .

HTML ids are only needed when using or . The template always generates an HTML id; with , this is optional and never creates ids.

Line 93, Column 231: ID "ref_1" already defined
ref=
: An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).

This similar diagnostic occurs if an article contains multiple invocations of with the same ID, for example, two instances of "...ence plainlinks nourlexpansion" id="<abbr title="Position where error was detected." style="color:red"><strong>r</strong></abbr><nowiki></nowiki>". To fix the problem, use different IDs. Templates using the ref_ id prefix include , , and .


Missing alt text
Line 135, Column 108: required attribute "alt" not specified

<nowiki></nowiki>
: The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element....

This diagnostic can result from use of the extension, which does not support and does not generate for visually impaired readers. Such a problem can be fixed by redoing the timeline as text, as an image, or as an .


Element dl is missing a required instance of child element dd
Error Line 78, Column 5: Element dl is missing a required instance of child element dd.
<nowiki></nowiki><abbr title="Position where error was detected." style="color:red"><strong>&gt;</strong></abbr>
: Content model for element dl:
:: Zero or more groups each consisting of one or more dt elements followed by one or more dd elements.

Definition lists are created with the wikimarkup </dl<span style="color:red"><strong>&gt;</strong></span> to define a definition list and ; to define the item in the list. This diagnostic results when the : is missing. This most often occurs when : is misused to bold a line. Use the wikimarkup ; to bold characters.


CSS validation
The W3C also has a CSS validator, but this is less of an issue when editing Wikipedia pages, as CSS is an option and CSS validation errors typically are due to problems with skins, not problems in individual pages.


See also
  • Template


External links

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
9/10 Page Rank
1517 Page Refs